package com.wy.powerbuilder.service.impl.lwg;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wy.powerbuilder.entity.ld.User;
import com.wy.powerbuilder.entity.lwg.houses;
import com.wy.powerbuilder.entity.lwg.owner;
import com.wy.powerbuilder.mapper.lwg.housesMapper;
import com.wy.powerbuilder.mapper.lwg.ownerMapper;

import com.wy.powerbuilder.service.lwg.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @description:
 * @author: 湖南叮当猫教育科技有限公司--聂长安
 * @contact: QQ1351261434、微信17670753912
 * @date: 2019/9/6 20:20
 * @Copyright 版权归叮当猫公司所有, 私自分享视频和源码属于违法行为
 */
@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private ownerMapper studentMapper;


    @Override
    public PageInfo<owner> selByPage(Integer pageNum, Integer pageSize,String o_state) {
        if(pageNum==null){
            pageNum = 1;//默认查询第一页
        }
        //对查询的信息进行分页
        //第一个参数当前页码,第二个每页的条数
        PageHelper.startPage(pageNum,pageSize ) ; //使用分页插件开始分页
        //查询我们将要分页的信息
        List<owner> students = studentMapper.all(o_state);
        //将查询的学生信息放到分页对象中去
        PageInfo<owner> pageInfo = new PageInfo<>(students);
        return pageInfo;
    }
    public owner showUser(int o_id) {
        return studentMapper.showUser(o_id);
    }


    public Integer updaAdmin(owner Owner) {
        return studentMapper.updaAdmin(Owner);
    }

}
